<?php

	class Users{
		private $db;
		
		public function __construct(){
			$this->db =& Application::database('default');
		}
		
		public function readUser($id){
			$stmt = $this->db->query('SELECT * FROM `users` WHERE `id` = ?', array($id));
			
			if($stmt['rowCount'] > 0){
				return $stmt['result'][0];
			}
			
			return false;
		}
		
		public function readUsers(){
			$stmt = $this->db->query('SELECT * FROM `users`');
			
			if($stmt['rowCount'] > 0){
				return $stmt['result'];
			}
			
			return false;
		}
	}

?>